<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .nav{
        background-color: antiquewhite;
        width: 500px;
        height: 30px;
        margin: 20px auto;
    }
    .item{
        width: 125px;
        float: left;
        line-height: 30px;
        text-align: center;
    }
    #hide{
        visibility: hidden;
    }
</style>
<body>
    <div class="nav">
        <div class="item">首页</div>
        <div class="item">个人主页</div>
        <div class="item">设置</div>
        <div class="item" id="hide">隐藏内容</div>
    </div>
    <script>
        var hideText = document.getElementById('hide');
        //通过textContent属性返回获得到的元素的内容
        console.log(hideText.textContent);
        console.log(hideText.innerText);
        hideText.textContent = '特定时刻显示';
        console.log(hideText.textContent);
    </script>
</body>
</html>